import { createStore } from 'vuex'
import cart from './modules/cart'
import user from './modules/user'
import category from './modules/category'
import createPersistedState from "vuex-persistedstate";
export default createStore({

  state: {
    name: '呆呆狗'
  },
  getters: {},
  mutations: {
  },
  actions: {
  },
  modules: {
    user, cart, category
  },
  // 配置插件
  plugins: [
    createPersistedState({
      // 本地存储的名字
      key: 'erabbit-client-pc-store',
      // 指定需要存储的模块
      paths: ['user', 'cart']
    })
  ]
})
